d<!DOCTYPE HTML>
<html lang="utf-8">
<head>
<meta charset="utf-8">
<title>驾车宝典-发表新话题</title>
<link href="${ctx}/styles/forum.css" rel="stylesheet" type="text/css">
<#include '/baseHead.ftl'>

<!--主要部分开始-->
<section id="main"><div class="bgA_01">
	
	<div class="breadcrumbPanel_01">
		<p>
				 <a href="/${ctx}" title="回到首页">首页</a> &gt;
				 <a href="<@forumList cityNo="${group.cityNo}" cateId="${group.fkCateId}" filter="0" titleTypeId="0" pageNumber="1" orderBy="1"  />" title="${group.cateName}">${group.cateName}</a> &gt; 
				 <span class="on"> <a href="<@groupDetailLink groupId="${group.groupId?c}" />" title="${group.groupName}">${group.groupName}</a>
		</p>
	</div>
	
	<div class="forumEditPanel_01">
		<div class="formField">
		<form id="editorForm" action="${ctx}/topic/createtopic" method="post">
			<div class="formList">
				<dl>
					<input type="text" name="topicTitleBeforeFilter" id="topicTitleBeforeFilter" class="txt" size=100 placeholder="请输入标题,标题最大长度为30个中文字" onkeyup='calRemain();'>
					<span>还可输入 <strong id="remain">30</strong> 个字符</span>
				</dl>
			</div>
			<div class="formContent">
			  	<textarea id="content" name="topicContBeforeFilter" style="height:508px;width:908px"></textarea>
			</div>
		</div>
		<input type="hidden" name="from" id="from" value="/group/detail/${group.groupId?c}">
		<input type="hidden" name="fkGroupId"  value="${group.groupId?c}">
		<input type="hidden" value="1" name="topicType" id="topicType">
		<input type="hidden" value="1" name="fkTitleTypeId" id="fkTitleTypeId">
		</form>
		<div class="checkField">
		<!--
			<input type="checkbox" id="shareToWeibo" name="shareTo" class="check" checked><label for="shareToWeibo">同时发布到新浪微博</label>
			<input type="checkbox" id="shareToTencent" name="shareTo" class="check" checked><label for="shareToTencent">同时发布到腾讯微博</label>
		-->
		</div>
		<div class="btnField">
			<input type="button" class="btn btn1" onclick='checkSubmit();' value="" style="width:85px"></button>
		</div>
	</div>

<#include '/commonFriendLink.ftl'>

</div></section>
<!--主要部分结束-->
<#include '/baseFoot.ftl'>
<script charset="gbk" src="${ctx}/scripts/kindeditor-min.js"></script>
<script>
	
	function calRemain(){
		if ( $('#topicTitleBeforeFilter').val().length > 30 ){
			$('#remain').html("0");
			 $('#topicTitleBeforeFilter').val( $('#topicTitleBeforeFilter').val().substr(0,30) );
		}
		$('#remain').html(30 -   $('#topicTitleBeforeFilter').val().length);
	}
	function checkSubmit(){
		if ( $('#topicTitleBeforeFilter').val()  ==  "" ){
			alert("请输入标题");
			setBorder("topicTitleBeforeFilter");
			return false ;
		}else{
			clearBorder("topicTitleBeforeFilter");
		}
		if ( $('#topicTitleBeforeFilter').val().length >30){
			alert("标题最多为30 个字符");
			setBorder("topicTitleBeforeFilter");
			return false ;
		}else{
			clearBorder("topicTitleBeforeFilter");
		}
		var  content = $('#content').val();
		if ( content.length <  20 ){
			alert('内容不能少于20个字');
			return ;
		}
		document.forms["editorForm"].submit();
	}
	$(function(){
				KE.show({
				id : "content",
				imageUploadJson : '${ctx}/image/uploadimage',
					items : ['source','fontname', 'fontsize', '|', 'undo','redo','plainpaste','wordpaste','|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist','advtable','hr', '|', 'emoticons', 'image', 'link','|','flash','media'],
				resizeMode : 1,
				allowPreviewEmoticons : true,
				allowUpload : true,
				afterCreate : function(id) {
					KE.event.ctrl(document, 13, function() {
						KE.util.setData(id);
						if(checkSubmit()!=false)
							document.forms["editorForm"].submit();
					});
					KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
						KE.util.setData(id);
						if(checkSubmit()!=false)
							document.forms["editorForm"].submit();
					});
				}
				});
		});
</script>